package com.gz.droolsrule.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.gz.droolsrule.dao.BaseRuleActionRuleRelInfoMapper;
import com.gz.droolsrule.pojo.BaseRuleActionRuleRelInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ClassName: RuleActionRuleRelService <br/>
 * Description: <br/>
 * date: 2019/5/31 16:00<br/>
 * @author gz<br />
 * @since JDK 1.8
 */
@Service
public class RuleActionRuleRelService {
    @Autowired
    private BaseRuleActionRuleRelInfoMapper baseRuleActionRuleRelInfoMapper;

    /**
     * 方法说明: 获取规则与动作关系集合信息
     *
     * @param baseRuleActionRuleRelInfo 参数
     * @param page                      分页参数
     */
    public PageInfo<BaseRuleActionRuleRelInfo> findBaseRuleActionRuleRelInfoPage(BaseRuleActionRuleRelInfo baseRuleActionRuleRelInfo, PageInfo page) {
        PageHelper.startPage(page.getPageNum(), page.getPageSize());
        List<BaseRuleActionRuleRelInfo> list = this.baseRuleActionRuleRelInfoMapper.findBaseRuleActionRuleRelInfoList(baseRuleActionRuleRelInfo);
        return new PageInfo<>(list);
    }
}
